﻿using System.Collections.Generic;

namespace CoreEx.Common.Data
{
    /// <summary>
    /// Represents a row in a <see cref="ITable"/> instance.
    /// </summary>
    public interface IRow 
    {
        /// <summary>
        /// Gets or sets the <see cref="ITable"/> that this row belongs to.
        /// </summary>
        ITable Table { get; set; }

        /// <summary>
        /// Gets or sets the <see cref="ICell"/> value for the current row and column name
        /// </summary>
        /// <param name="columnName">The name of the column</param>
        /// <returns>The <see cref="ICell"/> value</returns>
        object this[string columnName]{ get; set;} 
      
        /// <summary>
        /// Gets an <see cref="IDictionary{TKey,TValue}"/> that contains the cells for the current row.
        /// </summary>
        IDictionary<string, ICell> Cells { get; }
    }
}